<!--
 * @Author: WLang
 * @LastEditors: WLang
 * @Description: 
 * @Date: 2023-07-25 20:36:58
 * @LastEditTime: 2023-07-29 12:35:10
 * @FilePath: \my-wyy\src\components\MusicItem.vue
-->
<template>
  <div class="wyy-songs-item">
    <div class="wyy-item-left">
      <div class="wyy-item-number" v-if="ishotList" :class="{active: hot}">
        {{sNumber}}
      </div>
      <div>
        <span class="wyy-item-name" v-html="songData.name"></span>
        <p class="wyy-item-desc"><i v-if="props.songData.sqMusic"></i><span v-html="props.songData.musicInfo"></span></p>
      </div>
    </div>
    <div class="wyy-item-right">
      <svg-icon iconName="play" class="wyy-right-play"></svg-icon>
    </div>
  </div>
</template>

<script setup>
import SvgIcon from './svgIcon.vue'
import {computed} from 'vue'
const props = defineProps({
  songData: {
    type: Object,
    defalut: () => []
  },
  idx: {
    type: Number
  },
  ishotList: {
    type: Boolean
  }
})
const sNumber = computed(() => {
let index = (props.idx + 1).toString();
return index[1] ? index : '0' + index
})

const hot = computed(() => {
  if (props.idx < 3)
  {
    return true
  }
  return false
})
</script>
<style lang="scss" scoped>
 .wyy-songs-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  padding: 10px;
  border-bottom: 1px solid #f1f1f2;
  .wyy-item-left {
    display: flex;
    align-items: center;
    .wyy-item-number {
      margin-right: 10px;
      font-size: 14px;
      color: #a4a6ae;
      &.active {
        color: #ec2a26;
      }
    }
    .wyy-item-name {
    font-size: 16px;
    color: #333;
    &::v-deep .keyword {
      color: #5472a9;
      }
    }
    .wyy-item-desc {
    font-size: 12px;
    line-height: 28px;
    color: #8e838e;
    display: flex;
    align-items: center;
    span ::v-deep .keyword {
      color: #5472a9;
      }
    i {
      width: 25px;
      height: 25px;
      background-image: url(../assets/images/index_icon_2x.png);
      background-position: 0 4px;
      transform: scale(0.5);
    }
  }

  }
  .wyy-item-right {
    .wyy-right-play {
      width: 24px;
      height: 24px;
      color: #a1a1a1;
    }
  }


 }
</style>